#ifndef __WIZ_VFS_HPP__SHANHAOBO_198004929__
#define __WIZ_VFS_HPP__SHANHAOBO_198004929__

#include "../Core/Accessor/WizAccessor.hpp"
#include "./WizVFSDirTree.hpp"

namespace Wiz
{
    namespace VFS
    {
        namespace Class
        {
            enum Type
            {
                eNormal,
                eBlockStorage,
            }; /// end of enum Type
        } /// end of namespace Class

        namespace Info
        {
            struct Type
            {
                ::Wiz::VFS::Class::Type     m_Class;
                ::Wiz::String::Type         m_FileName;
            };
            WIZ_DECLARE(::Wiz::VFS::Info::Type);

            namespace BlockStorage
            {
                struct Type : ::Wiz::VFS::Info::Type
                {
                    Type()
                        : m_BlockSize(4 * 1024)
                        , m_BlockCountPerChunk(256)
                    {
                        m_Class = ::Wiz::VFS::Class::eBlockStorage;
                        m_Endian = ::Wiz::Endian::Native::Test();
                    }
                    ::Wiz::Endian::Type     m_Endian;
                    ::Wiz::UInt16::Type     m_BlockSize;
                    ::Wiz::UInt16::Type     m_BlockCountPerChunk;
                };
                WIZ_DECLARE(::Wiz::VFS::Info::BlockStorage::Type);
            } /// end of namespace BlockStorage
        } /// end of namespace Info

        struct Type
        {
            virtual ::Wiz::Bool::Type   Read(::Wiz::ByteBuffer::Out, ::Wiz::String::In) = 0;
            virtual ::Wiz::Bool::Type   Write(::Wiz::ByteBuffer::In, ::Wiz::String::In) = 0;
            virtual ::Wiz::Bool::Type   Replace(::Wiz::ByteBuffer::In, ::Wiz::String::In) = 0;
            virtual ::Wiz::Bool::Type   Remove(::Wiz::String::In) = 0;

            virtual ::Wiz::Void::Type   PrintDirTree() = 0;
        }; /// end of struct Type
        WIZ_DECLARE(::Wiz::VFS::Type);

        WIZ_EXPORT ::Wiz::VFS::Ptr Create(::Wiz::VFS::Info::In);
        WIZ_EXPORT ::Wiz::VFS::Ptr Load(::Wiz::String::In);
        WIZ_EXPORT ::Wiz::Void::Type Destroy(::Wiz::VFS::Ptr);
    } /// end of namespace VFS
} /// end of namespace Wiz

#endif /*__WIZ_VFS_HPP__SHANHAOBO_198004929__*/
